import { axios } from "@/utils/request";

// 打印模版-分页查询打印模版列表
export function queryByPage(data, saas) {
  return axios({
    url: "/onlcode/saas/print/template/queryByPage",
    method: "post",
    data,
    headers: {
      saas
    }
  });
}

// 打印模版-根据id获取打印模版信息
export function getById(data, saas) {
  return axios({
    url: "/onlcode/saas/print/template/getById",
    method: "get",
    params: data,
    headers: {
      saas
    }
  });
}

// 打印模版-根据项目id获取打印模版属性列表
export function getPrintTemplateFields(data, saas) {
  return axios({
    url: "/onlcode/saas/print/template/getPrintTemplateFields",
    method: "post",
    data,
    headers: {
      saas
    }
  });
}

// 打印模版-新增或修改打印模版
export function saveOrUpdate(data, saas) {
  return axios({
    url: "/onlcode/saas/print/template/saveOrUpdate",
    method: "post",
    data,
    headers: {
      saas
    }
  });
}

// 打印模版-查询数据表模型列表
export function queryTableList(data, saas) {
  return axios({
    url: "/onlcode/saas/base/table/queryTableList",
    method: "post",
    data,
    headers: {
      saas
    }
  });
}

// 打印模版-根据表id查询所有字段
export function queryColumnByTableId(data, saas) {
  return axios({
    url: "/onlcode/saas/base/table/queryColumnByTableId",
    method: "post",
    data,
    headers: {
      saas
    }
  });
}

export function queryPrintDefaultTemplate(params, saas) {
  return axios({
    url: '/onlcode/saas/print/template/queryDefaultTemplate',
    method: 'post',
    params,
    headers: {
      saas
    }
  })
}